<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <style type="text/css">
            .col-label {
                width: 110px;
                text-align: right;
            }

            .col-label2 {
                /*padding-left: 80px;*/
                width: 110px;
                text-align: right;
            }

            .col-input {
                width: 180px;
            }

            .col-qry1 {
                width: 50%;
            }
        </style>
        <script language="JavaScript" type="text/JavaScript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.id != 'editForm:btnAccept') {
                        event.keyCode = 9;
                    }
                }
            }
        </script>
    </ui:define>

    <ui:define name="content">
        <div style="margin:5px;">
            <p:growl id="msgs" showDetail="false"/>
            <h:form id="editForm">
                <p:focus for="voucherid"/>
                <p:panel header="查询数据">
                    <h:panelGrid width="100%" cellspacing="0" border="0" columns="2" columnClasses="col-qry1">
                        <h:panelGroup>
                            <h:panelGrid cellspacing="0" border="0" columns="5">
                                <h:outputLabel value="支付凭证:"/>
                                <h:inputText id="voucherid" autocomplete="off" value="#{paybackBatchAction.vchid}"
                                             style="width:100px"/>
                                <p:spacer width="5px"/>
                                <h:outputLabel value="卡号:"/>
                                <h:inputText id="txtAcct" value="#{paybackBatchAction.acct}"
                                             style="width:100px;">
                                </h:inputText>
                                <h:outputLabel value="还款状态"></h:outputLabel>
                                <h:selectOneMenu value="#{paybackBatchAction.payStscode}">
                                    <f:selectItems value="#{paybackBatchAction.payStsList}"></f:selectItems>
                                </h:selectOneMenu>
                            </h:panelGrid>
                        </h:panelGroup>
                        <h:panelGrid cellspacing="0" border="0" columns="1">
                            <h:panelGroup>
                                <p:commandButton style="width:60px;" ajax="true"
                                                 id="btnAccept" update="msgs qrydt btnSave"
                                                 value="查 询"
                                                 action="#{paybackBatchAction.onBtnQueryClick}"></p:commandButton>
                            </h:panelGroup>
                        </h:panelGrid>
                    </h:panelGrid>
                </p:panel>
                <p:ajaxStatus style="height:18px;text-align:center">
                    <f:facet name="start">
                        <h:graphicImage value="/images/ajaxloadingbar.gif"/>
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value=""/>
                    </f:facet>
                </p:ajaxStatus>
                <p:panel>
                    <p:dataTable style="width:100%" value="#{paybackBatchAction.gwkPaybackinfoList}" var="record"
                                 id="qrydt" rowKey="#{record.pkid}" selection="#{paybackBatchAction.gwkPaybackinfos}"
                                 paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 paginator="true" rows="10" paginatorPosition="bottom"
                                 rowsPerPageTemplate="100,50,30,10,5"
                                 emptyMessage="数据记录为空...">
                        <p:column selectionMode="multiple"/>
                        <p:column headerText="支付凭证" style="text-align:center">
                            <h:outputText value="#{record.voucherid}"></h:outputText>
                        </p:column>
                        <p:column headerText="卡号(单击可修改)" style="text-align:center">
                            <p:inplace cancelLabel="true" style="background-color:#dcdcdc;">
                                <h:inputText value="#{record.account}" id="coltxtacct">
                                    <p:ajax event="blur" listener="#{paybackBatchAction.cardisExist}" update="msgs">
                                    </p:ajax>
                                </h:inputText>
                            </p:inplace>
                        </p:column>
                        <p:column headerText="持卡人" style="text-align:center">
                            <h:outputText value="#{record.cardname}"></h:outputText>
                        </p:column>
                        <p:column headerText="还款金额" style="text-align:center">
                            <h:outputText value="#{record.amt}">
                                <f:convertNumber pattern="###,##0.00"/>
                            </h:outputText>
                        </p:column>
                        <p:column headerText="还款状态" style="text-align:center">
                            <h:outputText
                                    value="#{paybackAction.payStatus.aliasEnums[record.status].title}"></h:outputText>
                        </p:column>
                        <p:column headerText="还款文件生成标志" style="text-align:center">
                            <h:outputText value="#{record.filesendflag}"></h:outputText>
                        </p:column>
                        <p:column headerText="确认还款标志" style="text-align:center">
                            <h:outputText
                                    value="#{paybackAction.confirmPayFlg.aliasEnums[record.confirmpayflag].title}"></h:outputText>
                        </p:column>
                    </p:dataTable>
                </p:panel>
                <p:panel>
                    <h:panelGrid columns="1" cellpadding="2" border="0" style="width:100%;text-align:center;">
                        <h:panelGroup>
                            <h:commandButton id="btnSave"
                                             action="#{paybackBatchAction.onBtnSaveClick}"
                                             value="修改确认"
                                             style="width:90px">
                            </h:commandButton>
                        </h:panelGroup>
                    </h:panelGrid>
                </p:panel>
            </h:form>
        </div>
    </ui:define>

</ui:composition>